Skip to content

feat: secure Stellar signing, cross-tab auth, live feed, SBTi dashboard - #609

Merged
Oluwaseyi89 merged 2 commits into
CarbonScribe:mainfrom
fadee26:feat/signing-auth-feed-sbti
Aug 31, 2026
Merged

feat: secure Stellar signing, cross-tab auth, live feed, SBTi dashboard#609
Oluwaseyi89 merged 2 commits into
CarbonScribe:mainfrom
fadee26:feat/signing-auth-feed-sbti

Conversation

@fadee26

@fadee26 fadee26 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

closes #542 — Secure Stellar key management
Backend corporate-platform-backend/src/stellar/signing/

  • SigningProvider interface: getPublicKey(), signTransaction(), isLive()
  • EnvSigningProvider (default/dev) + KmsSigningProvider (prod skeleton)
  • Distinct providers: SIGNING_PROVIDER_CONTRACT / SIGNING_PROVIDER_TRANSFER
  • SorobanService + TransferService inject providers — no process.env.STELLAR_SECRET_KEY outside signing/
  • Explicit STELLAR_SIGNING_MODE=simulate|live (no silent missing-key simulate)
  • Startup fail-fast in live mode when secret/public key invalid
  • Audit logs include public key + keyId per signature
  • config.schema.ts validates signing env vars
  • KEY_ROTATION.md + unit tests for misconfig / simulate mode

closes #550 — Cross-tab auth sync
Web AuthContext + lib/auth/cross-tab-auth.ts

  • BroadcastChannel('cs-auth') for login / logout / refresh
  • storage listener fallback (older browsers)
  • Logout clears all tabs; login/refresh re-runs syncProfile
  • Leader election (cs_auth_leader) so only one tab proactive-refreshes
  • Unit tests for storage keys, leader lock, broadcast safety

closes #552 — Live retirement feed reconnect
Web components/feed/LiveRetirementFeed.tsx

  • Real WebSocket to NEXT_PUBLIC_RETIREMENT_STREAM_URL (or /api/v1/retirements/stream)
  • Exponential backoff reconnect (cap 30s)
  • States: connecting / connected / reconnecting / disconnected / error + Retry
  • Pause closes the socket; visibility pause when tab hidden
  • Dedup by event id; skeleton while connecting; no mock companies
  • Empty components/retirement/LiveRetirementFeed.tsx → re-export

closes #546 — SBTi dashboard aggregation
Backend ProgressTrackingService + SbtiService.getDashboard()

  • Completion %, linear on-track/behind/ahead, time-series per target
  • Status summary counts + scope 1/2/3 rollups
  • Reuses getRetirementGap(); failures logged → dataQuality: 'partial'
  • 3-minute in-memory cache
  • Unit tests for on-track / behind / ahead / missing data

Verify

# Backend
cd corporate-platform/corporate-platform-backend
npm test -- signing
npm test -- progress-tracking

# Web
cd corporate-platform/corporate-platform-web
npm test -- cross-tab-auth
npm test -- LiveRetirementFeed

Closes #542
Closes #550
Closes #552
Closes #546

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@fadee26 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Oluwaseyi89
Oluwaseyi89 merged commit 3d17001 into CarbonScribe:main Aug 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants